package com.xiangpq.pattern.structuralPatterns.proxyPattern.staticProxy;

/**
 * @author XPQ
 * @function 客户端调用者，购买商品类
 * @since 2024-03-31
 */
public class ShopApplication {

    public static void main(String[] args) {
        float price = 0.0f;
        Taobao taobao = new Taobao();
        try {
            price = taobao.sell(2);
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("taobao 购买价格price:" + price);
        System.out.println("====================================");

        WeiShang weiShang = new WeiShang();
        try {
            price = weiShang.sell(1);
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("weishang 购买价格price:" + price);
    }
}
